import request from "@/utils/request";

/**
 * 获取列表
 * @param {} params
 * @returns
 */
export function getData(params) {
  return request({
    url: "/gift/magic-gift",
    method: "get",
    params
  });
}

/**
 * 删除礼物
 */
export function deleteData(ids) {
  return request({
    url: "/gift",
    method: "delete",
    data: { ids }
  });
}

/**
 * 获取操作类型列表
 * @param {} params
 * @returns
 */
export function getTypeData() {
  return request({
    url: "/gift/op-types",
    method: "get",
    params: { op_type_category: 3 }
  });
}

/**
 * 添加魔法礼物
 * @param {} params
 * @returns
 */
export function postData(data) {
  return request({
    url: "/gift/magic-gift",
    method: "post",
    data
  });
}

/**
 * 编辑礼物
 * @param {} data
 * @returns
 */
export function putData(data) {
  return request({
    url: "/gift/magic-gift",
    method: "put",
    data
  });
}

/**
 * 设置定时上下架
 */
export function postStatusCrontab(data) {
  return request({
    url: "/gift/status-crontab",
    method: "post",
    data
  });
}

/**
 * 置顶
 */
export function postSetTop(id) {
  return request({
    url: "/gift/set-top",
    method: "put",
    data: { id }
  });
}

/**
 * 切换上下架
 */
export function postChangeStatus(id) {
  return request({
    url: "/gift/status",
    method: "put",
    data: { id }
  });
}
